package com.cskaoyan.bean;

import com.cskaoyan.bean.vo.HandleOption;

public class OrderStatus {
    private Integer showType;
    private String orderStatusText;
    private HandleOption handleOption;
    private short orderStatus;

    public void setOrderStatus(short orderStatus) {
        if (orderStatus == 101) {
            //cancel: true, delete: false, pay: true, comment: false, confirm: false, refund: false, rebuy: false
            setHandleOption(new HandleOption(true, false, true, false, false, false, false));
            setOrderStatusText("未付款");
        } else if (orderStatus == 102) {
            //cancel: false, delete: true, pay: false, comment: false, confirm: false, refund: false, rebuy: false
            setHandleOption(new HandleOption(false, true, false, false, false, false, false));
            setOrderStatusText("已取消");
        } else if (orderStatus == 103) {
            //cancel: false, delete: true, pay: false, comment: false, confirm: false, refund: false, rebuy: false
            setHandleOption(new HandleOption(false, true, false, false, false, false, false));
            setOrderStatusText("已取消(系统)");
        } else if (orderStatus == 201) {
            //cancel: false, delete: false, pay: false, comment: false, confirm: false, refund: true, rebuy: false
            setHandleOption(new HandleOption(false, false, false, false, false, true, false));
            setOrderStatusText("已付款");
        } else if (orderStatus == 202) {
            //cancel: false, delete: false, pay: false, comment: false, confirm: false, refund: false, rebuy: false
            setHandleOption(new HandleOption(false, false, false, false, false, false, false));
            setOrderStatusText("订单取消，退款中");
        } else if (orderStatus == 203) {
            //cancel: false, delete: true, pay: false, comment: false, confirm: false, refund: false, rebuy: false
            setHandleOption(new HandleOption(false, true, false, false, false, false, false));
            setOrderStatusText("已退款");
        } else if (orderStatus == 301) {
            //cancel: false, delete: false, pay: false, comment: false, confirm: true, refund: false, rebuy: false
            setHandleOption(new HandleOption(false, false, false, false, true, false, false));
            setOrderStatusText("已发货");
        }  else if (orderStatus == 401) {
            //cancel: false, delete: true, pay: false, comment: true, confirm: false, refund: false, rebuy: true
            setHandleOption(new HandleOption(false, true, false, true, false, false, true));
            setOrderStatusText("已收货");
        } else if (orderStatus == 402) {
            //cancel: false, delete: true, pay: false, comment: true, confirm: false, refund: false, rebuy: true
            setHandleOption(new HandleOption(false, true, false, true, false, false, true));
            setOrderStatusText("已收货(系统)");
        }
        this.orderStatus = orderStatus;
    }

    public short getOrderStatus() {
        return orderStatus;
    }

    public Integer getShowType() {
        return showType;
    }

    public void setShowType(Integer showType) {
        if (showType.equals(1)) {
            setOrderStatus((short) 101);
        } else if (showType.equals(2)) {
            setOrderStatus((short) 201);
        } else if (showType.equals(3)) {
            setOrderStatus((short) 301);
        } else if (showType.equals(4)) {
            setOrderStatus((short) 401);
        }
        this.showType = showType;
    }

    public String getOrderStatusText() {
        return orderStatusText;
    }

    public void setOrderStatusText(String orderStatusText) {
        this.orderStatusText = orderStatusText;
    }

    public HandleOption getHandleOption() {
        return handleOption;
    }

    public void setHandleOption(HandleOption handleOption) {
        this.handleOption = handleOption;
    }
}
